Optimal. Leaf size=287 \[ -\frac{b \left (6 a^2 b^2 B-3 a^3 b C+a^4 B-a b^3 C+3 b^4 B\right )}{a^3 d \left (a^2+b^2\right )^2 (a+b \tan (c+d x))}-\frac{b \left (2 a^2 B-a b C+3 b^2 B\right )}{2 a^2 d \left (a^2+b^2\right ) (a+b \tan (c+d x))^2}+\frac{b^2 \left (9 a^2 b^3 B-3 a^3 b^2 C+10 a^4 b B-6 a^5 C-a b^4 C+3 b^5 B\right ) \log (a \cos (c+d x)+b \sin (c+d x))}{a^4 d \left (a^2+b^2\right )^3}-\frac{x \left (3 a^2 b C+a^3 B-3 a b^2 B-b^3 C\right )}{\left (a^2+b^2\right )^3}-\frac{(3 b B-a C) \log (\sin (c+d x))}{a^4 d}-\frac{B \cot (c+d x)}{a d (a+b \tan (c+d x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.9412, antiderivative size = 287, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 40, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.15, Rules used = {3632, 3609, 3649, 3651, 3530, 3475} \[ -\frac{b \left (6 a^2 b^2 B-3 a^3 b C+a^4 B-a b^3 C+3 b^4 B\right )}{a^3 d \left (a^2+b^2\right )^2 (a+b \tan (c+d x))}-\frac{b \left (2 a^2 B-a b C+3 b^2 B\right )}{2 a^2 d \left (a^2+b^2\right ) (a+b \tan (c+d x))^2}+\frac{b^2 \left (9 a^2 b^3 B-3 a^3 b^2 C+10 a^4 b B-6 a^5 C-a b^4 C+3 b^5 B\right ) \log (a \cos (c+d x)+b \sin (c+d x))}{a^4 d \left (a^2+b^2\right )^3}-\frac{x \left (3 a^2 b C+a^3 B-3 a b^2 B-b^3 C\right )}{\left (a^2+b^2\right )^3}-\frac{(3 b B-a C) \log (\sin (c+d x))}{a^4 d}-\frac{B \cot (c+d x)}{a d (a+b \tan (c+d x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3632
Rule 3609
Rule 3649
Rule 3651
Rule 3530
Rule 3475
Rubi steps
\begin{align*} \int \frac{\cot ^3(c+d x) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right )}{(a+b \tan (c+d x))^3} \, dx &=\int \frac{\cot ^2(c+d x) (B+C \tan (c+d x))}{(a+b \tan (c+d x))^3} \, dx\\ &=-\frac{B \cot (c+d x)}{a d (a+b \tan (c+d x))^2}-\frac{\int \frac{\cot (c+d x) \left (3 b B-a C+a B \tan (c+d x)+3 b B \tan ^2(c+d x)\right )}{(a+b \tan (c+d x))^3} \, dx}{a}\\ &=-\frac{b \left (2 a^2 B+3 b^2 B-a b C\right )}{2 a^2 \left (a^2+b^2\right ) d (a+b \tan (c+d x))^2}-\frac{B \cot (c+d x)}{a d (a+b \tan (c+d x))^2}-\frac{\int \frac{\cot (c+d x) \left (2 \left (a^2+b^2\right ) (3 b B-a C)+2 a^2 (a B+b C) \tan (c+d x)+2 b \left (2 a^2 B+3 b^2 B-a b C\right ) \tan ^2(c+d x)\right )}{(a+b \tan (c+d x))^2} \, dx}{2 a^2 \left (a^2+b^2\right )}\\ &=-\frac{b \left (2 a^2 B+3 b^2 B-a b C\right )}{2 a^2 \left (a^2+b^2\right ) d (a+b \tan (c+d x))^2}-\frac{B \cot (c+d x)}{a d (a+b \tan (c+d x))^2}-\frac{b \left (a^4 B+6 a^2 b^2 B+3 b^4 B-3 a^3 b C-a b^3 C\right )}{a^3 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))}-\frac{\int \frac{\cot (c+d x) \left (2 \left (a^2+b^2\right )^2 (3 b B-a C)+2 a^3 \left (a^2 B-b^2 B+2 a b C\right ) \tan (c+d x)+2 b \left (a^4 B+6 a^2 b^2 B+3 b^4 B-3 a^3 b C-a b^3 C\right ) \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx}{2 a^3 \left (a^2+b^2\right )^2}\\ &=-\frac{\left (a^3 B-3 a b^2 B+3 a^2 b C-b^3 C\right ) x}{\left (a^2+b^2\right )^3}-\frac{b \left (2 a^2 B+3 b^2 B-a b C\right )}{2 a^2 \left (a^2+b^2\right ) d (a+b \tan (c+d x))^2}-\frac{B \cot (c+d x)}{a d (a+b \tan (c+d x))^2}-\frac{b \left (a^4 B+6 a^2 b^2 B+3 b^4 B-3 a^3 b C-a b^3 C\right )}{a^3 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))}-\frac{(3 b B-a C) \int \cot (c+d x) \, dx}{a^4}+\frac{\left (b^2 \left (10 a^4 b B+9 a^2 b^3 B+3 b^5 B-6 a^5 C-3 a^3 b^2 C-a b^4 C\right )\right ) \int \frac{b-a \tan (c+d x)}{a+b \tan (c+d x)} \, dx}{a^4 \left (a^2+b^2\right )^3}\\ &=-\frac{\left (a^3 B-3 a b^2 B+3 a^2 b C-b^3 C\right ) x}{\left (a^2+b^2\right )^3}-\frac{(3 b B-a C) \log (\sin (c+d x))}{a^4 d}+\frac{b^2 \left (10 a^4 b B+9 a^2 b^3 B+3 b^5 B-6 a^5 C-3 a^3 b^2 C-a b^4 C\right ) \log (a \cos (c+d x)+b \sin (c+d x))}{a^4 \left (a^2+b^2\right )^3 d}-\frac{b \left (2 a^2 B+3 b^2 B-a b C\right )}{2 a^2 \left (a^2+b^2\right ) d (a+b \tan (c+d x))^2}-\frac{B \cot (c+d x)}{a d (a+b \tan (c+d x))^2}-\frac{b \left (a^4 B+6 a^2 b^2 B+3 b^4 B-3 a^3 b C-a b^3 C\right )}{a^3 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))}\\ \end{align*}
Mathematica [C] time = 6.40237, size = 288, normalized size = 1. \[ -\frac{b^2 \left (4 a^2 b B-3 a^3 C-a b^2 C+2 b^3 B\right )}{a^3 d \left (a^2+b^2\right )^2 (a+b \tan (c+d x))}-\frac{b^2 (b B-a C)}{2 a^2 d \left (a^2+b^2\right ) (a+b \tan (c+d x))^2}+\frac{b^2 \left (9 a^2 b^3 B-3 a^3 b^2 C+10 a^4 b B-6 a^5 C-a b^4 C+3 b^5 B\right ) \log (a+b \tan (c+d x))}{a^4 d \left (a^2+b^2\right )^3}-\frac{(3 b B-a C) \log (\tan (c+d x))}{a^4 d}-\frac{B \cot (c+d x)}{a^3 d}+\frac{(B+i C) \log (-\tan (c+d x)+i)}{2 d (-b+i a)^3}-\frac{(C+i B) \log (\tan (c+d x)+i)}{2 d (a-i b)^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.174, size = 651, normalized size = 2.3 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.80384, size = 613, normalized size = 2.14 \begin{align*} -\frac{\frac{2 \,{\left (B a^{3} + 3 \, C a^{2} b - 3 \, B a b^{2} - C b^{3}\right )}{\left (d x + c\right )}}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac{2 \,{\left (6 \, C a^{5} b^{2} - 10 \, B a^{4} b^{3} + 3 \, C a^{3} b^{4} - 9 \, B a^{2} b^{5} + C a b^{6} - 3 \, B b^{7}\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{10} + 3 \, a^{8} b^{2} + 3 \, a^{6} b^{4} + a^{4} b^{6}} + \frac{{\left (C a^{3} - 3 \, B a^{2} b - 3 \, C a b^{2} + B b^{3}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac{2 \, B a^{6} + 4 \, B a^{4} b^{2} + 2 \, B a^{2} b^{4} + 2 \,{\left (B a^{4} b^{2} - 3 \, C a^{3} b^{3} + 6 \, B a^{2} b^{4} - C a b^{5} + 3 \, B b^{6}\right )} \tan \left (d x + c\right )^{2} +{\left (4 \, B a^{5} b - 7 \, C a^{4} b^{2} + 17 \, B a^{3} b^{3} - 3 \, C a^{2} b^{4} + 9 \, B a b^{5}\right )} \tan \left (d x + c\right )}{{\left (a^{7} b^{2} + 2 \, a^{5} b^{4} + a^{3} b^{6}\right )} \tan \left (d x + c\right )^{3} + 2 \,{\left (a^{8} b + 2 \, a^{6} b^{3} + a^{4} b^{5}\right )} \tan \left (d x + c\right )^{2} +{\left (a^{9} + 2 \, a^{7} b^{2} + a^{5} b^{4}\right )} \tan \left (d x + c\right )} - \frac{2 \,{\left (C a - 3 \, B b\right )} \log \left (\tan \left (d x + c\right )\right )}{a^{4}}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.82269, size = 1982, normalized size = 6.91 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.6371, size = 756, normalized size = 2.63 \begin{align*} -\frac{\frac{2 \,{\left (B a^{3} + 3 \, C a^{2} b - 3 \, B a b^{2} - C b^{3}\right )}{\left (d x + c\right )}}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac{{\left (C a^{3} - 3 \, B a^{2} b - 3 \, C a b^{2} + B b^{3}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac{2 \,{\left (6 \, C a^{5} b^{3} - 10 \, B a^{4} b^{4} + 3 \, C a^{3} b^{5} - 9 \, B a^{2} b^{6} + C a b^{7} - 3 \, B b^{8}\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{10} b + 3 \, a^{8} b^{3} + 3 \, a^{6} b^{5} + a^{4} b^{7}} - \frac{18 \, C a^{5} b^{4} \tan \left (d x + c\right )^{2} - 30 \, B a^{4} b^{5} \tan \left (d x + c\right )^{2} + 9 \, C a^{3} b^{6} \tan \left (d x + c\right )^{2} - 27 \, B a^{2} b^{7} \tan \left (d x + c\right )^{2} + 3 \, C a b^{8} \tan \left (d x + c\right )^{2} - 9 \, B b^{9} \tan \left (d x + c\right )^{2} + 42 \, C a^{6} b^{3} \tan \left (d x + c\right ) - 68 \, B a^{5} b^{4} \tan \left (d x + c\right ) + 26 \, C a^{4} b^{5} \tan \left (d x + c\right ) - 66 \, B a^{3} b^{6} \tan \left (d x + c\right ) + 8 \, C a^{2} b^{7} \tan \left (d x + c\right ) - 22 \, B a b^{8} \tan \left (d x + c\right ) + 25 \, C a^{7} b^{2} - 39 \, B a^{6} b^{3} + 19 \, C a^{5} b^{4} - 41 \, B a^{4} b^{5} + 6 \, C a^{3} b^{6} - 14 \, B a^{2} b^{7}}{{\left (a^{10} + 3 \, a^{8} b^{2} + 3 \, a^{6} b^{4} + a^{4} b^{6}\right )}{\left (b \tan \left (d x + c\right ) + a\right )}^{2}} - \frac{2 \,{\left (C a - 3 \, B b\right )} \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{a^{4}} + \frac{2 \,{\left (C a \tan \left (d x + c\right ) - 3 \, B b \tan \left (d x + c\right ) + B a\right )}}{a^{4} \tan \left (d x + c\right )}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]